home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / tcl / tests / concat.test < prev    next >
Text File  |  1992-11-06  |  2KB  |  45 lines

  1. # Commands covered:  concat
  2. #
  3. # This file contains a collection of tests for one or more of the Tcl
  4. # built-in commands.  Sourcing this file into Tcl runs the tests and
  5. # generates output for errors.  No output means no errors were found.
  6. #
  7. # Copyright 1991 Regents of the University of California
  8. # Permission to use, copy, modify, and distribute this
  9. # software and its documentation for any purpose and without
  10. # fee is hereby granted, provided that this copyright notice
  11. # appears in all copies.  The University of California makes no
  12. # representations about the suitability of this software for any
  13. # purpose.  It is provided "as is" without express or implied
  14. # warranty.
  15. #
  16. # $Header: /sprite/src/lib/tcl/tests/RCS/concat.test,v 1.4 91/07/23 21:00:59 ouster Exp $ (Berkeley)
  17.  
  18. if {[string compare test [info procs test]] == 1} then {source defs}
  19.  
  20. test concat-1.1 {simple concatenation} {
  21.     concat a b c d e f g
  22. } {a b c d e f g}
  23. test concat-1.2 {merging lists together} {
  24.     concat a {b c d} {e f g h}
  25. } {a b c d e f g h}
  26. test concat-1.3 {merge lists, retain sub-lists} {
  27.     concat a {b {c d}} {{e f}} g h
  28. } {a b {c d} {e f} g h}
  29. test concat-1.4 {special characters} {
  30.     concat a\{ {b \{c d} \{d
  31. } "a{ b \\{c d {d"
  32.  
  33. test concat-2.1 {error: no arguments} {catch concat} 1
  34. test concat-2.2 {error: no arguments} {
  35.     catch concat msg
  36.     set msg
  37. } {wrong # args: should be "concat arg ?arg ...?"}
  38.  
  39. test concat-3.1 {pruning off extra white space} {
  40.     concat {} {a b c}
  41. } {a b c}
  42. test concat-3.2 {pruning off extra white space} {
  43.     concat x y "  a b c    \n\t  " "   "  " def "
  44. } {x y a b c def}
  45.